﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace He.Web.UI
{
    public class MsgBox
    {
        /// <summary>
        /// 弹窗
        /// </summary>
        /// <param name="msg">消息</param>
        public static void Show(string msg)
        {
            HttpContext.Current.Response.Write("<script>alert('" + msg + "');</script>");
        }

        /// <summary>
        /// 弹窗
        /// </summary>
        /// <param name="msg">消息</param>
        /// <param name="url">跳转地址</param>
        public static void Show(string msg, string url)
        {
            HttpContext.Current.Response.Write("<script>alert('" + msg + "');window.location='" + url + "'</script>");
            HttpContext.Current.Response.End();
        }

        public static void ShowError(string msg)
        {
            HttpContext.Current.Response.Write("<script>alert('" + msg + "');history.back(-1);</script>");
            HttpContext.Current.Response.End();
        }
    }
}
